import java.util.Comparator;


public class TimeStampComparator implements Comparator<TimeStampedMessage> {

	@Override
	public int compare(TimeStampedMessage o1, TimeStampedMessage o2) {
		int res = o1.getTs().compareTo(o2.getTs());
		if(res < 0)
			return -1;
		else if(res > 0)
			return 1;
		else		
			return 0;
	}



}
